package cn.tedu.store.controller;

import cn.tedu.store.entity.User;
import cn.tedu.store.mapper.UserMapper;
import cn.tedu.store.service.IUserService;
import cn.tedu.store.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/test/")
public class testController {
    @Autowired
    private IUserService userService;

    @Resource
    private UserMapper mapper;


    @RequestMapping(value = "test", method = RequestMethod.GET)
    public JsonResult test(String username,String pwd){
        System.out.println(username+"---"+pwd);
        System.out.println("从小程序段传递过来的内容为：---"+username + ">>>>>>" + pwd);
        try {
            User user2=userService.login(username, pwd);
        }catch (Exception e)
        {
            return new JsonResult(0);
        }
        return new JsonResult(1);
    }


}
